package my.myorm.tool.jdbc;

/**
 * 事务对象，每个事务对象里封装着一个SQLExecutor
 *
 * @author Skeven Huang
 * @version 1.0
 */
public class MyTransaction {
    private SQLExecutor executor = null;
    //已经开始-1，已经结束-2
    private int status = 1;

    /**
     * 获取该事务中的SQLExecutor
     *
     * @return
     */
    public SQLExecutor getExecutor() {
        return executor;
    }

    /**
     * 设置该事务中的SQLExecutor
     *
     * @param executor
     */
    public void setExecutor(SQLExecutor executor) {
        this.executor = executor;
    }

    /**
     * 获取该事务的状态 1-已经开始 2-已经提交 3-已经回滚 4-已经结束
     *
     * @return
     */
    public int getStatus() {
        return status;
    }

    /**
     * 设置该事务的状态
     *
     * @param status
     */
    public void setStatus(int status) {
        this.status = status;
    }
}
